﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<#include "/pages/include/include.ftl" />
<@h.css href="/css/uc.css"/>
<@h.js src="/javascripts/public/category.js"/>
<#include "/pages/include/setlayout.ftl" />
<script type="text/javascript">
 var manager = null;
 var comManager=null;
 var category=new category();

		$(function(){
			$("#tree1").ligerTree({  
	            data: ${data},
	            checkbox: false/*,
	            onBeforeCollapse:function(node){
	            	if(event.x>210)
	            		return false
	            	else
	           			return true;
	            },
	            onBeforeExpand:function(node){
	            	if(event.x>210)
	            		return false
	            	else
	           			return true;
	            }*/
            });
             manager = $("#tree1").ligerGetTreeManager();
             //manager.collapseAll();
           $("#txtPosition").ligerComboBox({
	            width: 130,
	            selectBoxWidth: 200,
	            selectBoxHeight: 200,treeLeafOnly:false,
	            tree: { data: ${data},checkbox:false},
	            valueFieldID: 'test3'
	        });
            $("#txtPosType").ligerComboBox({
	            width: 60,
	            data:  [
	            	{ text: '之前', id: '0' },
                    { text: '之后', id: '1' },
                    { text: '之下', id: '2' }],
	            valueFieldID: 'test4',
	            initValue:1,
	            initText:'之后'
	        });
		});
</script>
</head>

<body>
<#assign menuId="cates">
<div id="layout1" class="wrapper">
<#include "/pages/include/top.ftl" />
	
	<#include "/pages/person/myfile/file_menu.ftl" />
	
	<div position="center" title="分类编辑" style="overflow:auto;">
		<div class="action-div">
		<table class="sTable" cellpadding="0" cellspacing="0" border="0" >
			<tr>
				<td style="width:30px"><#if action.hasAuth("CATE_ADD")><a id="btn_add" onclick="category.showAdd()" class="minibutton"><span>增加</span></a></#if></td>
				<td style="width:30px"><#if action.hasAuth("CATE_DEL")><a id="btn_del" onclick="category.removeTreeItem()" class="minibutton"><span>删除</span></a></#if></td>
				<td style="width:30px"><#if action.hasAuth("CATE_EDIT")><a id="btn_edit" onclick="category.showEdit()" class="minibutton"><span>修改</span></a></#if></td>
				<td style="width:30px"><#if action.hasAuth("CATE_EDIT")><a id="btn_desc" onclick="category.showDesc()" class="minibutton"><span>简介</span></a></#if></td>
				<td style="width:40px"></td>
				<td style="width:40px">移至</td>
				<td style="width:140px"><input type="text" value="" id="txtPosition"/></td>
				<td style="width:30px"><input type="text" value="" id="txtPosType"/></td>
				<td style="width:30px"><#if action.hasAuth("CATE_MOVE")><a id="btn_move" onclick="category.changeItemPosition()" class="minibutton"><span>确定</span></a></#if></td>
			</tr>
		</table>
		</div>
		<ul id="tree1"></ul>
		<input type="hidden" id="test3" />
	</div>
	
	<#include "/pages/include/bottom.ftl" />
	
</div>

</body>

</html>
